#ifndef HISTORYPRODUCTSTANDARDITEMMODEL_H
#define HISTORYPRODUCTSTANDARDITEMMODEL_H

#include <QStandardItemModel>
#include "historyproduct.h"

class HistoryProductStandardItemModel : public QStandardItemModel
{
    Q_OBJECT
public:
    explicit HistoryProductStandardItemModel(QObject *parent = nullptr);

    QStringList header;

    bool setData(const QModelIndex &index, const QVariant &value, int role) override;

    QVariant data(const QModelIndex &index, int role) const override;

    void insertHistoryProduct(HistoryProduct &historyProduct);

    void insertHistoryProduct(QList<HistoryProduct*> historyProducts);

    QList<HistoryProduct*> getEditedHistoryProducts();

    void reset();
signals:

public slots:

private:
    QList<HistoryProduct*> historyProducts;
};

#endif // HISTORYPRODUCTSTANDARDITEMMODEL_H
